<template>
  <view>
    <!-- <view class="outGo" @click="goTous()">
      <image
        style="width: 40rpx; height: 40rpx; margin-top: 8rpx"
        src="../../../static/images/outs.png"
      ></image
    ></view> -->
    <view>
      <view class="headercontent">
        <view class="headerImage">
          <image src="../../../static/images/zuwu.jpg"></image>
        </view>
        <view class="headerTitle">租兀 </view>
      </view>
      <view class="conten">
        <view class="contenBox">
          <view>版本号</view>
          <view class="contenTit">
            <view class="contenNumber">V1.0.0</view>
          </view>
        </view>
        <view class="contenBox" @click="callPhone('193 9285 5785')">
          <view>联系电话</view>
          <view class="contenTit">
            <view class="contenNumber">193 9285 5785</view>
          </view>
        </view>
        <!-- <view class="contenBox" @click="callPhone('193 9285 5785')">
          <view>举报电话</view>
          <view class="contenTit">
            <view class="contenNumber">193 9285 5785</view>
          </view>
        </view> -->
      </view>
      <view class="conten">
        <view class="contenBox" @click="yinsi()">
          <view>隐私协议</view>
          <view class="contenTit">
            <view class="contenGo">
              <image src="../../../static/images/goto.png"></image>
            </view>
          </view>
        </view>
        <view class="contenBox" @click="fuwu()">
          <view>服务政策</view>
          <view class="contenTit">
            <view class="contenGo">
              <image src="../../../static/images/goto.png"></image>
            </view>
          </view>
        </view>
        <view class="contenBox" @click="zhuxiao()">
          <view>注销账号</view>
          <view class="contenTit">
            <view class="contenGo">
              <image src="../../../static/images/goto.png"></image>
            </view>
          </view>
        </view>
      </view>
      <view class="OutGo" @click="uichu()">退出登录</view>
    </view>
    <!-- <view class="Bottoms">
      <view class="BottomsBox">
        <navigator
          class="footnav"
          :url="`/pages/admin/business/index`"
          hover-class="none"
        >
          <view class="footBox">
            <view class="bottomeIcon">
              <image src="../../../static/images/home.png"></image>
            </view>
          </view>
          <view>首页</view>
        </navigator>
        <navigator
          class="footnav"
          :url="`/pages/admin/my/index`"
          hover-class="none"
        >
          <view class="footBox">
            <view class="bottomeIcon">
              <image src="../../../static/images/people1.png"></image>
            </view>
          </view>
          <view style="color: #5b7eef">个人</view>
        </navigator>
      </view>
    </view> -->
  </view>
</template>

<script>
import { getLogout } from "@/api/user.js";
export default {
  methods: {
    goTous(){
      uni.navigateTo({
        url: "/pages/admin/business/index",
      });
    },
    yinsi() {
      uni.navigateTo({
        url: "/pages/users/user_about/index?from=sys_userr_privacy",
      });
    },
    fuwu() {
      uni.navigateTo({
        url: "/pages/users/user_about/index?from=sys_user_agree",
      });
    },
    zhuxiao() {
      uni.navigateTo({
        url: "/pages/users/user_about/index?from=" + "the_cancellation_msg",
      });
    },
    uichu() {
      let that = this;
      uni.showModal({
        title: "提示",
        content: "确认退出登录?",
        success: function (res) {
          if (res.confirm) {
            getLogout()
              .then((res) => {
                that.$store.commit("LOGOUT");
                uni.redirectTo({
                  url: "/pages/users/login/index",
                });
              })
              .catch((err) => {
                console.log(err);
              });
          } else if (res.cancel) {
            console.log("用户点击取消");
          }
        },
      });
    },
    callPhone(phoneNumber) {
      // 判断是否为移动端
      const platform = uni.getSystemInfoSync().platform;
      if ("android" === platform || "ios" === platform) {
        // 在移动端直接使用uni.makePhoneCall() API
        uni.makePhoneCall({
          phoneNumber: phoneNumber, // 电话号码
          success: function () {
            console.log("拨号成功");
          },
          fail: function () {
            console.log("拨号失败");
          },
        });
      } else {
        // 在其他平台可能需要跳转到拨号页面，由用户手动拨号
        // 例如：window.location.href = 'tel:' + phoneNumber;
        console.log("请在移动设备上使用");
      }
    },
  },
};
</script>

<style scoped lang="scss">
.headercontent {
  margin-top: 100rpx;
}
.headerImage {
  margin: 0 auto;
  width: 138rpx;
  height: 138rpx;
  border-radius: 50%;
  image {
    border-radius: 50%;
    width: 100%;
    height: 100%;
  }
}
.headerTitle {
  margin-top: 30rpx;
  text-align: center;
}
.Bottoms {
  width: 100%;
  position: fixed;
  bottom: 0;
  .BottomsBox {
    display: flex;
    justify-content: space-between;
  }
}
.footnav {
  padding-bottom: 50rpx;
  padding-top: 20rpx;
  width: 50%;
  background: #fff;
  text-align: center;
}
.bottomeIcon {
  margin: 0 auto;
  width: 48rpx;
  height: 48rpx;
  image {
    width: 100%;
    height: 100%;
  }
}
.conten {
  margin: 20rpx;
  background: #fff;
  border-radius: 30rpx;
  padding: 20rpx;
  .contenBox {
    padding: 30rpx 0;
    line-height: 40rpx;
    display: flex;
    justify-content: space-between;
  }
  .contenTit {
    display: flex;
    .contenGo {
      padding-left: 20rpx;
      width: 48rpx;
      height: 38rpx;
      image {
        width: 100%;
        height: 100%;
      }
    }
  }
}
.contenNumber {
  color: #999;
}
.OutGo {
  margin: 0 auto;
  background: red;
  height: 80rpx;
  line-height: 80rpx;
  border-radius: 50rpx;
  width: 450rpx;
  margin-bottom: 200rpx;
  color: #fff;
  text-align: center;
}
.outGo {
  margin-left: 40rpx;
  margin-top: 40rpx;
  width: 60rpx;
  height: 60rpx;
  border-radius: 50%;
  border: 2rpx solid #333;
  text-align: center;
}
</style>